import { Controller } from "../../mvc/core/Controller";
import { IMarketController } from "./interfaces/IMarketController";
import { DataEvent } from "../events/DataEvent";
import { GameController } from "../mvc/GameController";
import { LayerManager } from "../manager/LayerManager";
import { GameProxy } from "../mvc/GameProxy";
import { IView } from "../../mvc/interfaces/IView";
import { MarketModule } from "../../../modules/MarketModule";
import { IMarketModule } from "../../../modules/interfaces/IMarketModule";
import { IMarketSellWindow } from "../../../modules/interfaces/IMarketSellWindow";
import { MarketSellWindow } from "../view/market/MarketSellWindow";
import { IMarketSeekBuyWindow } from "../../../modules/interfaces/IMarketSeekBuyWindow";
import { MarketSeekBuyWindow } from "../view/market/MarketSeekBuyWindow";
import { NetDispatcher } from "../../mvc/core/NetDispatcher";
import { EGateCommand } from "../../../Message/Command/EGateCommand";
import { ServerCommand } from "../mvc/ServerCommand";
import { Dispatcher } from "../../mvc/core/Dispatcher";
import { EventName } from "../mvc/EventName";
import { ClockManager } from "../manager/ClockManager";
import { TimeEvent } from "../events/TimeEvent";
import { MessageBlock } from "../../../Framework/MQ/MessageBlock";
import { SSeqMarketItem } from "../../../Message/Game/SSeqMarketItem";
import { SMarketResult } from "../../../Message/Game/SMarketResult";
import { SearchConditionData } from "../view/market/SearchConditionData";
import { MsgManager } from "../manager/MsgManager";
import { Language } from "../../../extend/language/Language";
import { EMarketOperation } from "../../../Message/Game/EMarketOperation";
import { EMarketRecordType } from "../../../Message/Game/EMarketRecordType";
import { EMarketOrder } from "../../../Message/Game/EMarketOrder";
import { EMarketSearchType } from "../../../Message/Game/EMarketSearchType";
import { SMarketItem } from "../../../Message/Game/SMarketItem";
import { MoneyUtil } from "../view/common/util/MoneyUtil";
import { EPrictUnit } from "../../../Message/Public/EPrictUnit";
import { ItemData } from "../resource/info/ItemData";
import { StringHelper } from "../../../com/gengine/utils/StringHelper";
import { JSON } from "../../../com/mui/serialization/json/JSON";
import { GameDefConfig } from "../resource/GameDefConfig";
import { ECategory } from "../../../Message/Public/ECategory";
import { ColorConfig } from "../resource/ColorConfig";
import { SellGoodsTips } from "../view/market/SellGoodsTips";
import { TipsWindow } from "../view/player/TipsWindow";
import { SeekBuyItemInfo } from "../view/market/SeekBuyItemInfo";
type int = number;
//class MarketController
    
    export  class MarketController extends Controller implements IMarketController
    {
       

        /* internal  */onSeekBuyWindowStateChangeHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as Boolean;
            if (loc1 && GameController.pack.view.isHide) 
            {
                GameController.pack.view.show();
                if (!GameController.pack.view.isHide) 
                {
                    LayerManager.windowLayer.centerWindows(this.seekBuyWindow, GameController.pack.view, 20);
                }
            }
            return;
        }

        /* internal  */onMarketTypeChangeHandler(arg1: DataEvent): void
        {
            if (this._sellWindow && !this._sellWindow.isHide) 
            {
                this._sellWindow.hide();
            }
            else if (this._seekBuyWindow && !this._seekBuyWindow.isHide) 
            {
                this._seekBuyWindow.hide();
            }
            return;
        }

        /* internal  */onMarketChatWantToBuyHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as number;
            GameProxy.market.getRecordByMarketId(loc1);
            return;
        }

        protected /* override */ initView(): IView
        {
            if (this._market == null) 
            {
                this._market = new MarketModule();
            }
            return this._market;
        }

        public get market(): IMarketModule
        {
            if (this._market == null) 
            {
                this.initView();
            }
            return this._market;
        }

        public get sellWindow(): IMarketSellWindow
        {
            if (this._sellWindow == null) 
            {
                this._sellWindow = new MarketSellWindow();
            }
            return this._sellWindow;
        }

        public get seekBuyWindow(): IMarketSeekBuyWindow
        {
            if (this._seekBuyWindow == null) 
            {
                this._seekBuyWindow = new MarketSeekBuyWindow();
            }
            return this._seekBuyWindow;
        }

        public isSellWindowOpen(): Boolean
        {
            var loc1=false;
            if (this._sellWindow != null) 
            {
                loc1 = !this._sellWindow.isHide;
            }
            else 
            {
                loc1 = false;
            }
            return loc1;
        }

        public isSeekBuyWindowOpen(): Boolean
        {
            var loc1=false;
            if (this._seekBuyWindow != null) 
            {
                if (this.seekBuyWindow.getSeekBuySelectedIdx() == 0) 
                {
                    loc1 = !this._seekBuyWindow.isHide;
                }
                else 
                {
                    loc1 = false;
                }
            }
            else 
            {
                loc1 = false;
            }
            return loc1;
        }

        protected /* override */ initServer(): void
        {
            NetDispatcher.addCmdListener(EGateCommand._ECmdGateMarketSearch, this.onMarketSearchResultHandler);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGateMarketGetMySells, this.onMarketGetMySellsResultHandler);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGateMarketResultBuyItem, this.onMarketResultBuyItemHandler);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGateMarketResultSellItem, this.onMarketResultSellItemHandler);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGateMarketSearchCancelSell, this.onMarketSearchCancelSellHandler);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGateMarketGetMySeekBuys, this.onMarketGetMySeekBuysHandler);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGateMarketCancelSeekBuy, this.onMarketCancelSeekBuyHandler);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGateMarketResultSeekBuy, this.onMarketResultSeekBuyHandler);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGateMarketResultSellSeekItem, this.MarketResultSellSeekItemHandler);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGateMarketQuickSearch, this.onMarketQuickSearchHandler);
            NetDispatcher.addCmdListener(ServerCommand.MoneyUpdate, this.onMoneyUpdateHandler);
            Dispatcher.addEventListener(EventName.MarketSearch, this.onMarketSearchHandler);
            Dispatcher.addEventListener(EventName.MarketGetSelfGoods, this.onGetSelfGoodsHandler);
            Dispatcher.addEventListener(EventName.MarketOpenSell, this.onOpenSellHandler);
            Dispatcher.addEventListener(EventName.MarketGotoSell, this.onGotoSellHandler);
            Dispatcher.addEventListener(EventName.MarketCancelSell, this.onCancelSellHandler);
            Dispatcher.addEventListener(EventName.MarketBuyGoods, this.onBuyGoodsHandler);
            Dispatcher.addEventListener(EventName.MarketPrivateChat, this.onPrivateChatHandler);
            Dispatcher.addEventListener(EventName.BackPackClickToMarket, this.onBackPackClickToMarketHandler);
            Dispatcher.addEventListener(EventName.MarketOpenCoin, this.onMarketOpenCoinHandler);
            Dispatcher.addEventListener(EventName.MarketOpenSpecialTag, this.onOpenSpecialTagHandler);
            Dispatcher.addEventListener(EventName.MarketSellGoods, this.onMarketSellGoodsHandler);
            Dispatcher.addEventListener(EventName.MarketSeekBuyWindowOpen, this.onMarketSeekBuyWindowOpenHandler);
            Dispatcher.addEventListener(EventName.MarketSeekBuyGoodsInfo, this.onMarketSeekBuyGoodsInfoHandler);
            Dispatcher.addEventListener(EventName.MarketGetSelfSeekBuy, this.onMarketGetSelfSeekBuyHandler);
            Dispatcher.addEventListener(EventName.MarketSeekBuyWindowStateChange, this.onSeekBuyWindowStateChangeHandler);
            Dispatcher.addEventListener(EventName.MarketTypeChange, this.onMarketTypeChangeHandler);
            Dispatcher.addEventListener(EventName.MarketChatWantToBuy, this.onMarketChatWantToBuyHandler);
            Dispatcher.addEventListener(EventName.MarketChatWantToSell, this.onMarketChatWantToSellHandler);
            Dispatcher.addEventListener(EventName.MarketGetRecordSuccess, this.onMarketGetRecordSuccessHandler);
            ClockManager.instance.addEventListener(TimeEvent.ServerOpenDayChange, this.onServerOpenDayChangeHandler);
            return;
        }

        /* internal  */onMarketSearchResultHandler(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SSeqMarketItem;
            cache.market.sSeqMarketItem = loc1;
            this.market.updateMarketList(loc1);
            return;
        }

        /* internal  */onMarketGetMySellsResultHandler(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SSeqMarketItem;
            cache.market.sSeqMarketItemSell = loc1;
            cache.market.isSellSelfGoodsAlert = false;
            if (this.sellWindow.curSelectedIndex == 2) 
            {
                this.sellWindow.updateSelfGoods();
            }
            return;
        }

        /* internal  */onMarketResultBuyItemHandler(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SMarketResult;
            if (loc1.result) 
            {
                cache.market.isSellSelfGoodsAlert = true;
                this._targetPage = cache.market.getTargetPage(SearchConditionData.targetPage);
                GameProxy.market.search(this._codes, this._targetPage, this._levelLower, this._levelUpper, this._color, this._career, this._recordType, this._order);
                MsgManager.showRollTipsMsg(Language.getString(31000));
            }
            else 
            {
                MsgManager.showRollTipsMsg(Language.getString(31001));
            }
            return;
        }

        /* internal  */onMarketResultSellItemHandler(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SMarketResult;
            if (loc1.result) 
            {
                cache.market.isSellSelfGoodsAlert = true;
                GameProxy.market.getMySells(EMarketOperation._EMarketOperationGetMySells);
                MsgManager.showRollTipsMsg(Language.getString(31002));
                this.sellWindow.resetWindow();
            }
            else 
            {
                MsgManager.showRollTipsMsg(Language.getString(31003));
            }
            return;
        }

        /* internal  */onMarketSearchCancelSellHandler(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SMarketResult;
            if (loc1.result) 
            {
                GameProxy.market.getMySells(EMarketOperation._EMarketOperationGetMySells);
                MsgManager.showRollTipsMsg(Language.getString(31004));
            }
            else 
            {
                MsgManager.showRollTipsMsg(Language.getString(31005));
            }
            return;
        }

        /* internal  */onMarketGetMySeekBuysHandler(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SSeqMarketItem;
            cache.market.sSeqMarketItemSeek = loc1;
            cache.market.isSeekSelfGoodsAlert = false;
            this.seekBuyWindow.updateMySeekBuyPanel();
            return;
        }

        /* internal  */onMarketCancelSeekBuyHandler(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SMarketResult;
            if (loc1.result) 
            {
                this.updateSeekbuyInfo();
                GameProxy.market.getMySells(EMarketOperation._EMarketOperationGetMySeekBuys);
                MsgManager.showRollTipsMsg(Language.getString(31117));
            }
            else 
            {
                MsgManager.showRollTipsMsg(Language.getString(31118));
            }
            return;
        }

        /* internal  */onMarketResultSeekBuyHandler(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SMarketResult;
            if (loc1.result) 
            {
                this.updateSeekbuyInfo();
                cache.market.isSeekSelfGoodsAlert = true;
                GameProxy.market.getMySells(EMarketOperation._EMarketOperationGetMySeekBuys);
                MsgManager.showRollTipsMsg(Language.getString(31119));
            }
            else 
            {
                MsgManager.showRollTipsMsg(Language.getString(31120));
            }
            return;
        }

        /* internal  */MarketResultSellSeekItemHandler(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SMarketResult;
            if (loc1.result) 
            {
                this.updateSeekbuyInfo();
                MsgManager.showRollTipsMsg(Language.getString(31121));
                this.seekBuyWindow.resetQuickSellGoodsPanel();
            }
            else 
            {
                MsgManager.showRollTipsMsg(Language.getString(31122));
            }
            return;
        }

        /* internal  */updateSeekbuyInfo(): void
        {
            this._codes = new Map<any, any> /* flash.utils.Dictionary */();
            this._recordType = EMarketRecordType._EMarketRecordTypeSeekBuy;
            this._targetPage = 1;
            this._levelLower = 1;
            this._levelUpper = 100;
            this._color = 0;
            this._career = 0;
            this._order = EMarketOrder._EMarketOrderNormal;
            this._search = EMarketSearchType._EMarketSearchNormal;
            GameProxy.market.search(this._codes, this._targetPage, this._levelLower, this._levelUpper, this._color, this._career, this._recordType, this._order, this._search);
            return;
        }

        /* internal  */onMarketQuickSearchHandler(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SSeqMarketItem;
            if (cache.market.quickSearchType != 0) 
            {
                if (cache.market.quickSearchType == 1) 
                {
                    this.seekBuyWindow.updateSeekBuyGoodsPanel(loc1);
                }
            }
            else 
            {
                this.seekBuyWindow.updateQuickSellGoodsPanel(loc1);
            }
            SearchConditionData.codesMap = new Map<any, any> /* flash.utils.Dictionary */();
            cache.market.quickSearchType = -1;
            SearchConditionData.order = EMarketOrder._EMarketOrderNormal;
            return;
        }

        /* internal  */onMoneyUpdateHandler(arg1: Object): void
        {
            if (!(this._market == null) && !this._market.isHide) 
            {
                this.market.updateMoney();
            }
            return;
        }

        /* internal  */onMarketChatWantToSellHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as number;
            GameProxy.market.getRecordByMarketId(loc1);
            return;
        }

        /* internal  */onMarketGetRecordSuccessHandler(arg1: DataEvent): void
        {
            var loc3=0;
            var loc4=0;
            var loc5=null;
            var loc6=null;
            var loc7=null;
            var loc8=null;
            var loc9=null;
            var loc10=null;
            var loc11=0;
            var loc12=null;
            var loc13=null;
            var loc14=null;
            this._record = arg1.data as SMarketItem;
            var loc1=MoneyUtil.getFormatInt(this._record.sellPrice);
            var loc2="";
            if (this._record.sellUnit != EPrictUnit._EPriceUnitCoin) 
            {
                if (this._record.sellUnit == EPrictUnit._EPriceUnitGold) 
                {
                    loc1 = loc1 + " " + Language.getString(31037);
                }
            }
            else 
            {
                loc1 = loc1 + " " + Language.getString(31036);
            }
            if (this._record.sellUnit == EPrictUnit._EPriceUnitCoin && this._record.recordType == EMarketRecordType._EMarketRecordTypeSell && this._record.sellPrice > cache.role.money.coin) 
            {
                loc3 = this._record.sellPrice - cache.role.money.coin;
                Dispatcher.dispatchEvent(new DataEvent(EventName.ShopMallAutoBuyCoin, loc3));
            }
            else 
            {
                loc4 = this._record.code;
                loc5 = "";
                if (loc4 != EPrictUnit._EPriceUnitCoin) 
                {
                    if (loc4 != EPrictUnit._EPriceUnitGold) 
                    {
                        loc8 = new ItemData(loc4);
                        this._record.itemExtend = StringHelper.trim(this._record.itemExtend);
                        loc9 = "";
                        loc10 = "";
                        loc11 = 0;
                        if (!(this._record.itemExtend == "") && !(this._record.itemExtend == null) && !(this._record.itemExtend == "null")) 
                        {
                            if ((loc12 = JSON.deserialize(this._record.itemExtend)).prefix) 
                            {
                                loc11 = loc12.prefix;
                            }
                            if ((loc13 = GameDefConfig.instance.getEPrefixx(loc11, loc8.type)) && loc8.itemInfo.item.category == ECategory._ECategoryEquip) 
                            {
                                loc9 = loc13.name + Language.getString(31038);
                            }
                            if (!(loc12.strengthen == undefined) && !(loc12.strengthen == 0)) 
                            {
                                loc10 = "+" + loc12.strengthen;
                            }
                        }
                        loc5 = loc9 + loc8.itemInfo.item.name + loc10;
                    }
                    else 
                    {
                        loc5 = MoneyUtil.getFormatInt(this._record.amount) + Language.getString(31037);
                    }
                }
                else 
                {
                    loc5 = MoneyUtil.getFormatInt(this._record.amount) + Language.getString(31036);
                }
                loc6 = ColorConfig.instance.getItemColor(this._record.color).color;
                loc7 = "";
                if (this._record.code == EPrictUnit._EPriceUnitCoin || this._record.code == EPrictUnit._EPriceUnitGold) 
                {
                    if (this._record.recordType == EMarketRecordType._EMarketRecordTypeSell) 
                    {
                        loc7 = Language.getStringByParam(31040, loc6, loc5, loc1);
                    }
                }
                else if (this._record.recordType == EMarketRecordType._EMarketRecordTypeSell) 
                {
                    loc7 = Language.getStringByParam(31041, this._record.amount, loc6, loc5, loc1);
                }
                if (this._record.recordType != EMarketRecordType._EMarketRecordTypeSell) 
                {
                    if (this._record.recordType == EMarketRecordType._EMarketRecordTypeSeekBuy) 
                    {
                        if ((loc14 = (loc14 = cache.pack.backPackCache.getNotBindItemByCode(this._record.code)).concat(cache.pack.magicWeaponPackCache.getNotBindItemByCode(this._record.code))) && loc14.length <= 0) 
                        {
                            MsgManager.showRollTipsMsg(Language.getString(31127));
                            if (!SellGoodsTips.instance.isHide) 
                            {
                                SellGoodsTips.instance.hide();
                            }
                            return;
                        }
                        SellGoodsTips.instance.show();
                        SellGoodsTips.instance.updateInfo(this._record.color, this._record.sellPrice, this._record.sellUnit, loc14, this._record.amount, this.marketSureToSell);
                    }
                }
                else 
                {
                    TipsWindow.instance.show();
                    TipsWindow.instance.updateInfo(loc7, loc2, "", this.marketSureToBuy);
                    TipsWindow.instance.setNotTipsVisible(false);
                }
            }
            return;
        }

        /* internal  */marketSureToBuy(): void
        {
            GameProxy.market.buyMarketItem(this._record.marketId);
            return;
        }

        /* internal  */marketSureToSell(): void
        {
            GameProxy.market.sellSeekItem(this._record.marketId, SellGoodsTips.instance.itemUid, SellGoodsTips.instance.amount);
            return;
        }

        /* internal  */onServerOpenDayChangeHandler(arg1: TimeEvent): void
        {
            if (this._market && !this._market.isHide && ClockManager.instance.serverOpenDateNum >= 3) 
            {
                this._market.updateHotSellShow();
            }
            return;
        }

        /* internal  */onOpenSellHandler(arg1: DataEvent): void
        {
            var loc1=null;
            if (arg1.data != null) 
            {
                loc1 = arg1.data as ItemData;
                this.sellWindow.show();
                this.sellWindow.setSellGoodsItem(loc1);
            }
            if (this.sellWindow.isHide) 
            {
                this.sellWindow.show();
                GameController.pack.view.show();
            }
            else if (arg1.data == null && !this.sellWindow.isHide) 
            {
                this.sellWindow.hide();
            }
            if (!GameController.pack.view.isHide) 
            {
                LayerManager.windowLayer.centerWindows(this.sellWindow, GameController.pack.view, 20);
            }
            return;
        }

        /* internal  */onMarketSearchHandler(arg1: DataEvent): void
        {
            var loc1=0;
            this._codes = SearchConditionData.codesMap;
            this._targetPage = SearchConditionData.targetPage;
            this._levelLower = SearchConditionData.levelLower;
            this._levelUpper = SearchConditionData.levelUpper;
            this._color = SearchConditionData.color;
            if (arg1.data && !(arg1.data.eggColor == null)) 
            {
                loc1 = arg1.data.eggColor;
                if (loc1 > -1) 
                {
                    this._color = loc1;
                }
            }
            this._career = SearchConditionData.career;
            this._recordType = SearchConditionData.recordType;
            this._order = SearchConditionData.order;
            if (arg1.isResult) 
            {
                this._search = EMarketSearchType._EMarketSearchQuickSell;
            }
            else 
            {
                this._search = EMarketSearchType._EMarketSearchNormal;
            }
            this._codes = this.getTopNumDict(500, this._codes);
            GameProxy.market.search(this._codes, this._targetPage, this._levelLower, this._levelUpper, this._color, this._career, this._recordType, this._order, this._search);
            return;
        }

        /* internal  */getTopNumDict(arg1: int, arg2: Map<any, any> /* flash.utils.Dictionary */): Map<any, any> /* flash.utils.Dictionary */
        {
            var loc1=0;
            var loc2=null;
            var loc3=null;
            if (arg2) 
            {
                loc2 = new Map<any, any> /* flash.utils.Dictionary */();
                var loc4=0;
                var loc5=arg2;
                for (loc3 in loc5) 
                {
                    ++loc1;
                    if (loc1 >= arg1) 
                    {
                        break;
                    }
                    loc2[loc3] = loc3;
                }
                if (loc1 < arg1) 
                {
                    return arg2;
                }
                return loc2;
            }
            return null;
        }

        /* internal  */onGetSelfGoodsHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as Boolean;
            if (this.sellWindow.isHide) 
            {
                this.sellWindow.show();
                this.sellWindow.updateSelfGoods();
            }
            else if (loc1) 
            {
                this.sellWindow.hide();
            }
            if (this.sellWindow.isHide) 
            {
                return;
            }
            GameProxy.market.getMySells(EMarketOperation._EMarketOperationGetMySells);
            return;
        }

        /* internal  */onGotoSellHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data;
            var loc2=loc1.code as int;
            var loc3=loc1.itemUid as string;
            var loc4=loc1.amount as int;
            var loc5=loc1.price as int;
            var loc6=loc1.unit as int;
            var loc7=loc1.time as int;
            var loc8=loc1.broadcast as Boolean;
            GameProxy.market.sellItem(loc2, loc3, loc4, loc5, loc6, loc7, loc8);
            return;
        }

        /* internal  */onCancelSellHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data;
            var loc2=loc1.marketId as number;
            var loc3=loc1.operation as int;
            GameProxy.market.cancelSell(loc3, loc2);
            return;
        }

        /* internal  */onBuyGoodsHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as number;
            GameProxy.market.buyMarketItem(loc1);
            return;
        }

        /* internal  */onPrivateChatHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as string;
            return;
        }

        /* internal  */onBackPackClickToMarketHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as ItemData;
            if (!(this._sellWindow == null) && !this._sellWindow.isHide) 
            {
                this._sellWindow.setSellGoodsItem(loc1);
            }
            return;
        }

        /* internal  */onMarketOpenCoinHandler(arg1: DataEvent): void
        {
            this.market.openSellCoinTag();
            return;
        }

        /* internal  */onOpenSpecialTagHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data;
            this.market.openSpecialTag((loc1.oneId as int - 1), (loc1.twoIndex as int - 1));
            return;
        }

        /* internal  */onMarketSellGoodsHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data;
            var loc2=loc1.marketId;
            var loc3=loc1.uid;
            var loc4=loc1.amount;
            GameProxy.market.sellSeekItem(loc2, loc3, loc4);
            return;
        }

        /* internal  */onMarketSeekBuyWindowOpenHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as int;
            this.seekBuyWindow.show();
            this.seekBuyWindow.updatePanel(loc1);
            return;
        }

        /* internal  */onMarketSeekBuyGoodsInfoHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as SeekBuyItemInfo;
            GameProxy.market.seekBuy(loc1.code, loc1.amount, loc1.price, loc1.unit, loc1.time, loc1.prefixLimit, loc1.broadcast);
            return;
        }

        /* internal  */onMarketGetSelfSeekBuyHandler(arg1: DataEvent): void
        {
            GameProxy.market.getMySells(EMarketOperation._EMarketOperationGetMySeekBuys);
            return;
        }

        private /* var */_market: IMarketModule;

        private /* var */_sellWindow: IMarketSellWindow;

        private /* var */_seekBuyWindow: IMarketSeekBuyWindow;

        private /* var */_codes: Map<any, any> /* flash.utils.Dictionary */;

        private /* var */_targetPage: int;

        private /* var */_levelLower: int;

        private /* var */_levelUpper: int;

        private /* var */_color: int;

        private /* var */_record: SMarketItem;

        private /* var */_career: int;

        private /* var */_recordType: int;

        private /* var */_order: int;

        private /* var */_search: int;
    }
